package top.aprillie.mamabike.record.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.aprillie.mamabike.common.exception.MaMaBikeException;
import top.aprillie.mamabike.record.dao.RideRecordMapper;
import top.aprillie.mamabike.record.entity.RideRecord;

import java.util.List;

/**
 * @Author: illure
 * @Description:
 * @Date: Created in 13:50 2018/2/18
 * @Modified By:
 */
@Service
@Slf4j
public class RideRecordServiceImpl implements RideRecordService {

    @Autowired
    private RideRecordMapper rideRecordMapper;


    /**
     * 每次查询10页单车记录
     *
     * @param userId
     * @param lastId
     * @return
     * @throws MaMaBikeException
     */
    @Override
    public List<RideRecord> listRideRecord(Long userId, Long lastId) throws MaMaBikeException {

        List<RideRecord> list = rideRecordMapper.selectRideRecordPage(userId, lastId);

        return list;
    }
}
